//
//  bfaClefViewController.m
//  Basson Fingering App
//
//  Created by mac on 10/19/12.
//  Copyright (c) 2012 Team Basson Fingering App. All rights reserved.
//

#import "bfaClefViewController.h"

@interface bfaClefViewController ()

@end

@implementation bfaClefViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void) viewSwipedUp{
    if ([self.clefImage image] == trebImage) {
        [self.clefImage setImage:tenorImage];
    }
    else if ([self.clefImage image] == tenorImage) {
        [self.clefImage setImage:bassImage];
    }
    else if ([self.clefImage image] == bassImage) {
        [self.clefImage setImage:trebImage];
    }
}

- (void) viewSwipedDown{
    if ([self.clefImage image] == trebImage) {
        [self.clefImage setImage:bassImage];
    }
    else if ([self.clefImage image] == tenorImage) {
        [self.clefImage setImage:trebImage];
    }
    else if ([self.clefImage image] == bassImage) {
        [self.clefImage setImage:tenorImage];
    }
}

- (void)viewDidLoad
{
    // load clef images
    trebImage = [UIImage imageNamed:@"treb_clef.png"];
    tenorImage = [UIImage imageNamed:@"tenor_clef.png"];
    bassImage = [UIImage imageNamed:@"bass_clef.png"];
    
    [self.clefImage setImage:bassImage];

    // create swipe gestures
    UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(viewSwipedUp)];
    swipeUp.numberOfTouchesRequired = 1;
    swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
    // add them to the view
    [self.view addGestureRecognizer:swipeUp];
    
    UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(viewSwipedDown)];
    swipeDown.numberOfTouchesRequired = 1;
    swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
    // add them to the view
    [self.view addGestureRecognizer:swipeDown];
    
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
